package com.graduation.springbootinit.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.graduation.springbootinit.model.entity.ActivityPart.Gift;
import com.graduation.springbootinit.model.entity.ActivityPart.ExchangeRecord;

public interface GiftService extends IService<Gift> {
    
    /**
     * 创建礼品
     */
    void createGift(Gift gift);
    
    /**
     * 获取礼品列表
     */
    Page<Gift> listGifts(int pageNum, int pageSize);
    
    /**
     * 兑换礼品
     */
    void exchangeGift(Long userId, Long giftId, Long addressId);
    
    /**
     * 获取用户兑换记录
     */
    Page<ExchangeRecord> getUserExchangeRecords(Long userId, int pageNum, int pageSize);
    
    /**
     * 更新兑换记录状态
     */
    void updateExchangeStatus(Long recordId, Integer status);
    
    /**
     * 检查礼品库存
     */
    boolean checkStock(Long giftId);
    
    /**
     * 减少礼品库存
     */
    void decreaseStock(Long giftId);
} 